package org.example.controller.SpringBoot300.CSDM;

import org.example.util.html.Jshoup;
import org.example.util.log.Logac;
import org.example.util.log.text.ExcelUtil;

import java.io.IOException;
import java.util.List;

/**
 * @auther admin闫
 * @Descriptopn 处理文档中的iframe标签
 * @date 2024/5/14 19:50
 */
public class InitIframe {

    public static void main(String[] args) {
        try {
            String filePath = "H:\\毕业设计工作目录\\batch_processing\\batch_processing\\piantou\\B站链接(1).xlsx";
            String[][] excelData = ExcelUtil.readExcel(filePath);
            for (String[] rowData : excelData) {
                String ifream="";
                String project=rowData[0];
                for (String cellData : rowData) {
//                    System.out.println("?"+cellData + "\t");

                    if (cellData.contains("iframe")){
                        List<String> list = Jshoup.iframeToSrc(cellData);

                        for (String s : list) {
                            ifream="<iframe width=\"960\" height=\"515\" src=\""+s+"\"  frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>";
                        }

                    }
                }
                System.out.println(project+ifream);
                InitArctic.initArctle(project,ifream);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
